<?php

class Form_Login extends Form_Custom_General {

    public function init() {

        $email = $this->createElement('text', 'email')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("login_required_email"))))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "span12", "placeholder" => $this->translateObj->translate("login_frm_email")));
        $email->getValidator('emailAddress')->setMessage($this->translateObj->translate("login_required_valid_email"), Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($email);

        $password = $this->createElement('password', 'password')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("login_required_password"))))
                ->setAttribs(Array('class' => "span12", "placeholder" =>  $this->translateObj->translate("login_frm_password")));
        $this->addElement($password);
    }

}